/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: ActivityController
 * Author:   zhouheng
 * Date:     2019/6/19 23:13
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.golden.web.controller.activity;

import com.zhouh.golden.activity.common.ResultResp;
import com.zhouh.golden.activity.dto.ActDrawAwardRecordBean;
import com.zhouh.golden.activity.dto.ActivityTurntableDrawReq;
import com.zhouh.golden.activity.service.ActivityTurntableDrawService;
import com.zhouh.golden.common.domain.ResponseBo;
import com.zhouh.golden.web.controller.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/6/19
 * @since 1.0.0
 */
@RestController
@RequestMapping("/activity")
public class ActivityController extends BaseController{

    @Autowired
    ActivityTurntableDrawService activityTurntableDrawService;

    @RequestMapping("/doDraw")
    public ResponseBo draw(Long userId){
        ActivityTurntableDrawReq drawReq = new ActivityTurntableDrawReq();
        drawReq.setUserId(userId);
        ResultResp<ActDrawAwardRecordBean> resp = activityTurntableDrawService.draw(drawReq);

        ResponseBo responseBo = new ResponseBo();
        responseBo.put("code",resp.getReturnCodeEnum().getCode());
        responseBo.put("data",resp.getResult());

        return responseBo;
    }
}